package com.ruoyi.common.validation.validator;


import com.ruoyi.common.constant.RegexPool;
import com.ruoyi.common.validation.PasswordEasy;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 密码校验
 *
 * @author siashan
 * @date 2023-12-02
 */
public class PasswordEasyValidator implements ConstraintValidator<PasswordEasy, String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        return value.matches(RegexPool.PASSWORD_EASY);
    }


    @Override
    public void initialize(PasswordEasy constraintAnnotation) {

    }
}
